using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using GameStateManagement;

namespace GameStateManagementSample.Classes
{
    class DebugRuler
    {
        public static void DrawRuler(GameScreen screen)
        {
            SpriteBatch spriteBatch = screen.ScreenManager.SpriteBatch;
            SpriteFont font = screen.ScreenManager.Font;

            for (int i = 0; i < spriteBatch.GraphicsDevice.Viewport.Width; i = i + 10)
            {
                if (i % 100 == 0)
                {
                    LineBatchTester.LineBatch.DrawLine(spriteBatch, Color.White, new Vector2(i, 0), new Vector2(i, 30));
                    string Text = i.ToString();
                    Vector2 textSize = font.MeasureString(Text);
                    Vector2 scale = Vector2.One / 2;
                    textSize *= scale;
                    Vector2 textPosition = new Vector2(i, 35) - textSize / 2f;

                    spriteBatch.DrawString(font, Text, textPosition, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0);

                }
                else
                {
                    LineBatchTester.LineBatch.DrawLine(spriteBatch, Color.White, new Vector2(i, 0), new Vector2(i, 10));
                }
            }
            for (int i = 0; i < spriteBatch.GraphicsDevice.Viewport.Height; i = i + 10)
            {
                if (i % 100 == 0)
                {
                    LineBatchTester.LineBatch.DrawLine(spriteBatch, Color.White, new Vector2(0, i), new Vector2(30, i));
                    string Text = i.ToString();
                    Vector2 textSize = font.MeasureString(Text);
                    Vector2 scale = Vector2.One / 2;
                    textSize *= scale;
                    Vector2 textPosition = new Vector2(35,i) - textSize / 2f;

                    spriteBatch.DrawString(font, Text, textPosition, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0);

                }
                else
                {
                    LineBatchTester.LineBatch.DrawLine(spriteBatch, Color.White, new Vector2(0, i), new Vector2(10, i));
                }
            }
        }
    }
}
